{extend name="layout/layout" /}

{block name="pagecss"}
<link href="__STATIC__/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
{/block}

{block name="content"}
<div class="row">
    <div class="col-lg-12">
        <div class="portlet light">
            <div class="row">
                <div class="col-md-10">
                    <form id="searchForm" action="{$pageSize.url}" class="form" method="post">
                        <div class="form-inline">
                            <!--<label>类型 ：</label>-->
                            <select id="memberType" name="memberType" class="form-control">
                                <option value="">选择类型</option>
                                <option value="1">本地居民</option>
                                <option value="2">外来人口</option>
                                <option value="3">流动人口</option>
                            </select>
                            <span class="town-div">
                                {if condition="($admin->type == 3) OR ($admin->type == 6)"}
                                {$selectarea['cityname']}->{$selectarea['xianname']}->{$selectarea['townname']}
                                {if !$selectarea['villagename']}
                                    <select id="village" name="villageId" class="form-control"></select>
                                {/if}
                                {elseif condition="($admin->type == 4)"}
                                {$selectarea['cityname']}->{$selectarea['xianname']}->{$selectarea['townname']}->{$selectarea['villagename']}
                                {elseif condition="($admin->type == 2)"}
                                {$selectarea['cityname']}->{$selectarea['xianname']}
                                <select id="town" name="townId" class="form-control" data-hasvillage="on" ></select>
                                <select id="village" name="villageId" class="form-control"></select>
                                {elseif condition="($admin->type == 1)"}
                                {$selectarea['cityname']}
                                <select id="xian" name="xianId" class="form-control"></select>
                                <select id="town" name="townId" class="form-control" data-hasvillage="on" ></select>
                                <select id="village" name="villageId" class="form-control"  ></select>
                                {else/}
                                <select id="city" name="cityId" class="form-control"></select>
                                <select id="xian" name="xianId" class="form-control"></select>
                                <select id="town" name="townId" class="form-control" data-hasvillage="on" ></select>
                                <select id="village" name="villageId" class="form-control"></select>
                                {/if}

                                <input type="hidden" class="form-control city" name="city" value="">
                                <input type="hidden" class="form-control xian" name="xian" value="">
                                <input type="hidden" class="form-control town" name="town" value="">
                                <input type="hidden" class="form-control village" name="village" value="">
                            </span>
                            <input type="text" class="form-control" name="name" value="" placeholder="姓名">
                            <input type="text" class="form-control" name="identityNumber" value="" placeholder="身份证">
                            &nbsp;&nbsp;&nbsp;
                            <button id="doSearch" type="button" class="btn btn-success" title="筛选">
                                <i class="fa fa-search"></i> 筛选
                            </button>
                            <!--<a href="{$currentUrl}?reset=1" class="btn btn-danger"><i class="fa fa-trash"></i> 清空</a>-->
                            <button type="reset" class="btn btn-danger" title="清空">
                                <i class="fa fa-trash"></i> 清空
                            </button>
                        </div>
                    </form>
                </div>

                <div class="col-md-2">
                    <div class="pull-right">
                        <!--<button type="button" id="export_csv" data-url="{:url('admin/member/export')}" class="btn dark btn-circle">
                            <i class="fa fa-download"></i> 导出数据
                        </button>-->
                        <button type="button" class="btn dark btn-circle" data-toggle="modal" data-target="#handle_modal">
                            <i class="fa fa-random"></i> 批量操作
                        </button>
                        <a href="{:url('admin/'.strtolower($model).'/add')}" class="btn blue btn-circle"><i class="fa fa-plus"></i> 添加</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row js-check-wrap">
    <div class="col-lg-12">
        <div class="portlet light">
            <div class="portlet-body">
                <form class="js-ajax-form" method="post">
                    <div class="">
                        <table id="data-table" class="table table-bordered table-hover dataTable">
                            <thead>
                            <tr>
                                <th>头像</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>手机号</th>
                                <th>身份证号</th>
                                <th>名族</th>
                                <th>所在地</th>
                                <th>人口类型</th>
                                <th>来源</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 操作弹框 -->
<div class="modal fade" id="handle_modal" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog" style="width:700px; height: 520px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">x</button>
                <h4 class="modal-title">批量操作</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="control-label col-md-4">
                                批量导入模板：
                            </label>
                            <div class="col-md-8">
                                <button type="button" id="download_template" class="btn blue" data-url="{:url('admin/member/downloadTemplate')}"> 下载Excel模板 </button>
                                <!--<a href="__UPLOAD__/csv/member/template.csv" download="template.csv" class="btn blue">下载Excel模板</a>-->
                                <span>请按照模板编辑数据</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row" style="margin: 10px 0">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="control-label col-md-4" style="padding: 0">
                                批量导入：
                            </label>
                            <div class="col-md-8">
                                <form id="import_form" action="{:url('admin/member/import')}" method="post" enctype="multipart/form-data">
                                    <input type="hidden" class="form-control" name="_token" value="">
                                    <button type="button" id="import_csv" class="btn blue" style="float: left;margin-right: 10px;margin-left: -5px"> 导入 </button>
                                    <input type="file" class="form-control" id="csv_file" name="csv_file" style="float: left;width: 60%">
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="control-label col-md-4">
                                批量导出：
                            </label>
                            <div class="col-md-8">
                                <button type="button" id="export_csv" data-url="{:url('admin/member/export')}" class="btn blue">
                                    <i class="fa fa-download"></i> 导出数据
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--<div class="modal-footer">
                <button type="button" class="btn default" data-dismiss="modal"> 关闭 </button>
            </div>-->
        </div>
    </div>
</div>

<input type="hidden" class="getregion_url" value="{:url('admin/region/getregion')}">
<input type="hidden" class="getvillage_url" value="{:url('admin/region/getvillage')}">
<input type="hidden" class="adminType" value="{$admin.type}">
<input type="hidden" class="adminCity" value="{$admin.cityId}">
<input type="hidden" class="adminXian" value="{$admin.xianId}">
<input type="hidden" class="adminTown" value="{$admin.townId}">
<input type="hidden" class="adminVillage" value="{$admin.villageId}">

<input type="hidden" class="datalist_url" value="{:url('admin/member/index')}">
<input type="hidden" class="edit_url" value="{:url('admin/member/edit')}">
<input type="hidden" class="delete_url" value="{:url('admin/member/delete')}">
<input type="hidden" class="detail_url" value="{:url('admin/member/detail')}">
{/block}

{block name="pagescript"}
<script src="__STATIC__/plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<script src="__STATIC__/admin/pages/js/searcharea.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/member.js" type="text/javascript"></script>
{/block}